package org.abacus.hibernate.mandarinduck;

import org.hibernate.Session;

/**
 *
 * @author chaoyang.li
 * @since 2012-08-30
 */
public abstract class HibernateSessionProvider extends org.abacus.hibernate.HibernateSessionProvider {
	public static final String hibernate_cfg_out_xml = "/hibernate/out/hibernate.cfg.xml";
	public static final String hibernate_cfg_in_xml = "/hibernate/in/hibernate.cfg.xml";

	/**
	 * @author chaoyang.li
	 */
	public static synchronized void addTags() {
		addTag(hibernate_cfg_out_xml);
		addTag(hibernate_cfg_in_xml);
	}

	/**
	 * @author chaoyang.li
	 */
	public static synchronized Session getCurrentSessionIn() {
		return getCurrentSession(hibernate_cfg_in_xml);
	}

	/**
	 * @author chaoyang.li
	 */
	public static synchronized Session getCurrentSessionOut() {
		return getCurrentSession(hibernate_cfg_out_xml);
	}

	/**
	 * @author chaoyang.li
	 */
	public static synchronized void closeIn() {
		close(hibernate_cfg_in_xml);
	}

	/**
	 * @author chaoyang.li
	 */
	public static synchronized void closeOut() {
		close(hibernate_cfg_out_xml);
	}
}
